<?php
    $params             = Zend_Controller_Front::getInstance()->getRequest()->getParams();
    $gameId             = 0;
    if(isset($params['game'])){
        $gameId         = $params['game'];
    }
    $menuModule         = Zend_Controller_Front::getInstance()->getRequest()->getModuleName();
    $menuController     = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
    $menuAction         = Zend_Controller_Front::getInstance()->getRequest()->getActionName();
    
    $auth               = $this->auth;
    $acl                = new My_Acl();
    $listAllow          = $acl->listAllowed($auth, $gameId);
    
    $listMenu           = array();
    foreach($listAllow as $row){
        if($row['moduleName'] == 'default' && $row['actionName'] == 'index' && !in_array($row['controllerName'], $listMenu)){
            $listMenu[$row['menu']]['controller']     = $row['controllerName'];
            $listMenu[$row['menu']]['name']     = $row['resourceName'];
        }
    }
    if($menuModule == 'default' && $gameId){
?>
<ul class="menu">
    <?php
        foreach($listMenu as $key=>$value){
            $str = "";
            if(strpos($key, '/'.$menuController.'/'))
                $str= ' active';
            echo '<li><a class="loading',$str,'" href="',$key,'/game/',$gameId,'">',$value['name'],'</a></li>';
        }
    ?>
</ul>
<?php } ?>